<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>menu1</title>
        <meta name="keywords" content="jquery,ui,easy,easyui,web">
        <meta name="description" content="easyui help you build your web page easily!">
        <link rel="stylesheet" type="text/css" href="/easyui/themes/default/easyui.css">
        <link rel="stylesheet" type="text/css" href="/easyui/themes/icon.css">

        <script type="text/javascript" src="/js/jquery.min.js"></script>
        <script type="text/javascript" src="/easyui/js/jquery.easyui.min.js"></script>
        <style>
            * {
                margin: 0;
                padding: 0;
            }
        </style>
    </head>
    <body>
        <h1>jQuery easyUI创建右击菜单</h1>
        <div>
            Click <a href="#" onclick="showmenu()">here</a> to show the menu.
        </div>
        <div id="mm" class="easyui-menu">
            <div onclick="javascript:alert('new')">New</div>
            <div>
                <span>Open</span>
                <div style="width:150px;">
                    <div>
                        <b>Word</b>
                    </div>
                    <div>Excel</div>
                    <div>PowerPoint</div>
                </div>
            </div>
            <div icon="icon-save">Save</div>
            <div class="menu-sep"></div>
            <div>Exit</div>
        </div>
        <script>
            $(function (e) {
                //鼠标右击触发事件
                $(document).bind('contextmenu',function(e){
                    $('#mm').menu('show', {
                        left: e.pageX,
                        top: e.pageY
                    });
                    return false;
                });
            });
            function showmenu(){
                $('#mm').menu('show', {
                    left: 200,
                    top: 100
                });
            }
        </script>


        <h1>简单按钮</h1>
        <div style="padding:5px;background:#fafafa;width:600px;border:1px solid #ccc">
            <a href="#" class="easyui-linkbutton" iconCls="icon-cancel">Cancel</a>
            <a href="#" class="easyui-linkbutton dead" iconCls="icon-reload">Refresh</a>
            <a href="#" class="easyui-linkbutton" iconCls="icon-search">Query</a>
            <a href="#" class="easyui-linkbutton">text button</a>
            <a href="#" class="easyui-linkbutton" iconCls="icon-print">Print</a>
        </div>
        <div style="padding:5px;background:#fafafa;width:600px;border:1px solid #ccc">
            <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-cancel">Cancel</a>
            <a href="#" class="easyui-linkbutton dead" plain="true" iconCls="icon-reload">Refresh</a>
            <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-search">Query</a>
            <a href="#" class="easyui-linkbutton" plain="true">text button</a>
            <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-print">Print</a>
            <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-help"></a>
            <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-save"></a>
            <a href="#" class="easyui-linkbutton" plain="true" iconCls="icon-back"></a>
        </div>
        <script>
            $(function (e) {
                // call the 'disable' method
                $('.dead').linkbutton('disable');
            });
        </script>


        <h1>菜单按钮结合</h1>
        <div style="background:#fafafa;padding:5px;width:300px;border:1px solid #ccc">
            <a href="#" class="easyui-menubutton" menu="#mm1" iconCls="icon-edit">Edit</a>
            <a href="#" class="easyui-menubutton" menu="#mm2" iconCls="icon-help">Help</a>
            <a href="#" class="easyui-menubutton" menu="#mm3" iconCls="icon-ok">Ok</a>
        </div>
        <div id="mm1" style="width:150px;">
            <div iconCls="icon-undo">Undo</div>
            <div iconCls="icon-redo">Redo</div>
            <div class="menu-sep"></div>
            <div>Cut</div>
            <div>Copy</div>
            <div>Paste</div>
            <div class="menu-sep"></div>
            <div iconCls="icon-remove">Delete</div>
            <div>Select All</div>
        </div>
        <div id="mm2" style="width:100px;">
            <div>Help</div>
            <div>Update</div>
            <div>About</div>
        </div>
        <div id="mm3" style="width:150px;">
            <div iconCls="icon-undo">Undo</div>
            <div iconCls="icon-redo">Redo</div>
            <div class="menu-sep"></div>
            <div>Cut</div>
            <div>Copy</div>
            <div>Paste</div>
            <div class="menu-sep"></div>
            <div>
                <span>Open</span>
                <div style="width:150px;">
                    <div>Firefox</div>
                    <div>Internet Explorer</div>
                    <div class="menu-sep"></div>
                    <div>Select Program...</div>
                </div>
            </div>
            <div iconCls="icon-remove">Delete</div>
            <div>Select All</div>
        </div>
    </body>

</html>